import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
    routes: [
        {
            path: '/',
            redirect: '/dashboard'
        },
        {
            path: '/',
            component: resolve => require(['../components/common/Home.vue'], resolve),
            meta: { title: '系统管理' },
            children:[
                {
                    path: '/dashboard',
                    component: resolve => require(['../components/page/Dashboard/index.vue'], resolve),
                    meta: { title: '系统首页', noclose: 1 }
                }, {
                    path: '/sys/role',
                    component: resolve => require(['../components/page/sys/role/index.vue'], resolve),
                    meta: { title: '角色管理' },
                },{
                    path: '/sys/account',
                    component: resolve => require(['../components/page/sys/account/index.vue'], resolve),
                    meta: { title: '账号管理' },
                },{
                    path: '/sys/organization',
                    component: resolve => require(['../components/page/sys/organization/index.vue'], resolve),
                    meta: { title: '组织结构' },
                },{
                    path: '/sys/dblog',
                    component: resolve => require(['../components/page/sys/dblog/index.vue'], resolve),
                    meta: { title: '系统日志' },
                }, {
                    path: '/sys/config',
                    component: resolve => require(['../components/page/sys/config/index.vue'], resolve),
                    meta: { title: '配置管理' },
                },{
                    path: '/sys/upfile',
                    component: resolve => require(['../components/page/sys/upfile/index.vue'], resolve),
                    meta: { title: '附件管理' },
                },{
                    path: '/sys/project',
                    component: resolve => require(['../components/page/sys/project/index.vue'], resolve),
                    meta: { title: '项目管理' },
                },{
                    path: '/app/config/ads',
                    component: resolve => require(['../components/page/app/config/ads/index.vue'], resolve),
                    meta: { title: '广告管理' },
                },{
                    path: '/app/config/version',
                    component: resolve => require(['../components/page/app/config/version/index.vue'], resolve),
                    meta: { title: '版本管理' },
                },{
                    path: '/app/post/tag',
                    component: resolve => require(['../components/page/app/post/tag/index.vue'], resolve),
                    meta: { title: '标签管理' },
                },{
                    path: '/app/post/post',
                    component: resolve => require(['../components/page/app/post/post/index.vue'], resolve),
                    meta: { title: '帖子管理' },
                },{
                    path: '/app/post/reply',
                    component: resolve => require(['../components/page/app/post/reply/index.vue'], resolve),
                    meta: { title: '帖子评论' },
                },{
                    path: '/app/hcenter/post',
                    component: resolve => require(['../components/page/app/hcenter/post/index.vue'], resolve),
                    meta: { title: '帮助中心' },
                },{
                    path: '/app/hcenter/event',
                    component: resolve => require(['../components/page/app/hcenter/event/index.vue'], resolve),
                    meta: { title: '工单管理' },
                },{
                    path: '/app/ucenter/user',
                    component: resolve => require(['../components/page/app/ucenter/user/index.vue'], resolve),
                    meta: { title: '会员管理' },
                },{
                    path: '/app/ucenter/star',
                    component: resolve => require(['../components/page/app/ucenter/star/index.vue'], resolve),
                    meta: { title: '入驻明星' },
                },{
                    path: '/app/mall/entity',
                    component: resolve => require(['../components/page/app/mall/entity/index.vue'], resolve),
                    meta: { title: '商品管理' },
                },{
                    path: '/app/mall/order',
                    component: resolve => require(['../components/page/app/mall/order/index.vue'], resolve),
                    meta: { title: '订单管理' },
                },{
                    path: '/app/mall/deposit',
                    component: resolve => require(['../components/page/app/mall/deposit/index.vue'], resolve),
                    meta: { title: '提现管理' },
                }
            ]
        },{
            path: '/login',
            component: resolve => require(['../components/page/Login.vue'], resolve)
        },{
            path: '/404',
            component: resolve => require(['../components/page/404.vue'], resolve)
        },{
            path: '/403',
            component: resolve => require(['../components/page/403.vue'], resolve)
        },{
            path: '/API/index',
            component: resolve => require(['../components/page/API/index.vue'], resolve)
        },{
            path: '*',
            redirect: '/404'
        }
    ]
})
